package com.summer.data.jql.concept.exp.filter_null;

import com.summer.data.Jsql;
import com.summer.data.dialect.Dialect;
import com.summer.data.jql.Context;
import com.summer.data.jql.behavior.FilterAble;
import com.summer.data.table.BaseColumn;

/**
 * @author 345480567@qq.com
 */
public class ColumnIsNull implements FilterAble {

    BaseColumn<?> column;

    public ColumnIsNull(BaseColumn<?> column) {
        this.column = column;
    }

    @Override
    public Jsql toFilterJsql(Context ctx, Dialect dialect) {
        Jsql jsql = Jsql.format(" %s is null ", column.toFieldSql(ctx, dialect));
        return jsql;
    }
}
